package domain.worm;

import com.uqbar.vainilla.DeltaState;

public abstract class WormState {

	private Worm worm;
	
	public WormState(Worm worm){
		this.worm = worm;
	}
	
	public void newState(WormState state){
		worm.setState(state);
	}

	public Worm getWorm() {
		return worm;
	}

	public void setWorm(Worm worm) {
		this.worm = worm;
	}

	public abstract void update(DeltaState deltaState);

	public void walk(DeltaState delta, int dir) {
		
	}

	public void jump() {
		
	}

	public void aim() {
		
	}
		
	public void toFallingState(){
		this.newState(new StateFalling(this.getWorm()));
	}
	public void toStandBy(){
		this.newState(new StandbyState(this.getWorm()));
	}
	public void toDead(){
		this.newState(new DeadState(this.getWorm()));
	}

}
